#include "stdafx.h"

#if _MSC_VER < 1400

void _tcscpy_s(char*s1 , int, const char* s2)
{
    _tcscpy(s1, s2);
}

void strcpy_s(char*s1 , int, const char* s2)
{
    strcpy(s1,s2);
}

void strcat_s(char*s1 , int, const char* s2)
{
    strcat(s1,s2);
}


int fopen_s(FILE** f, const char*na, const char* at)
{
    *f = fopen(na,at);
    if (*f==NULL) return 1;
    return 0;
}

void sprintf_s(char* var, int s, char*fmt,...)
{
    va_list  ap;
    va_start(ap, fmt);
    vsprintf(var, fmt, ap);
    va_end(ap);
}

void vsprintf_s(char* var, int s, const char*fmt,va_list&list)
{
    vsprintf(var, fmt, list);
}

#endif